Dynomotion

Group: DynoMotion Message: 6590 From: chrismd500 Date: 1/24/2013
Subject: Kstep analog output
Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
Group: DynoMotion Message: 6591 From: Tom Kerekes Date: 1/24/2013
Subject: Re: Kstep analog output
Hi Kris,

No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.  That motor requires 50ma.  See:

http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png

The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.

Regards
TK


Group: DynoMotion Message: 6592 From: chrismd500 Date: 1/24/2013
Subject: Re: Kstep analog output
Thanks Tom.

That's what I was afraid of. I thought about the relay output, but would have liked speed control.

An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?

If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
with the motors i mention below.

Kris

--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi Kris,
>
> No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.  That motor requires 50ma.  See:
>
>
> http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
>
>
> The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
>
> Regards
> TK
>
>
>
>
> ________________________________
> From: chrismd500
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, January 24, 2013 1:48 PM
> Subject: [DynoMotion] Kstep analog output
>
>
>  
> Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
>
Group: DynoMotion Message: 6593 From: Tom Kerekes Date: 1/24/2013
Subject: Re: Kstep analog output
Hi Kris,

So you are using 7 KFLOP motor axes already?  You need 2 more motors for focus on 2 cameras?

But yes I like that device.   Like you mention I don't think it is a good idea to switch motor coils with a relay.  But that device has two motor drivers so I don't think you need to.  Just use two of KFLOP's PWM outputs to drive each of the motor drivers.   The KFLOP PWM Outputs are on JP6.  If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO pins.  One PWM for each motor and one common direction pin.  To control the speed just write a PWM value to the FPGA register.  You don't need to have to use a KFLOP Axis Channel for this.

Regards
TK


Group: DynoMotion Message: 6594 From: chrismd500 Date: 1/24/2013
Subject: Re: Kstep analog output
Hi Tom,

> So you are using 7 KFLOP motor axes already?
Well, not sure how you define it, but I use 7 channels but "only" 5 mechanical axes as two of the axes use a slave motor each.

kstep #1:
ch0 + ch1(slave): Z
ch2 + ch3(slave): tilt

kstep #2:
ch4: X
ch5: Y
ch6: sherline 3700 rotary
ch7: none

> You need 2 more motors for focus on 2 cameras?
yes, two machine cameras with a Fujonon 16mm lens on each. http://www.fujifilmusa.com/products/optical_devices/machine-vision/2-3-5/hf16sa-1/

That is a much better solution, I like that! So if I understand you correct that DC driver should work with kflop?

Thanks,
Kris


--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi Kris,
>
> So you are using 7 KFLOP motor axes already?  You need 2 more motors for focus on 2 cameras?
>
> But yes I like that device.   Like you mention I don't think it is a good idea to switch motor coils with a relay.  But that device has two motor drivers so I don't think you need to.  Just use two of KFLOP's PWM outputs to drive each of the motor drivers.   The KFLOP PWM Outputs are on JP6.  If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO pins.  One PWM for each motor and one common direction pin.  To control the speed just write a PWM value to the FPGA register.  You don't need to have to use a KFLOP Axis Channel for this.
>
> Regards
> TK
>
>
>
>
> ________________________________
> From: chrismd500
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, January 24, 2013 3:34 PM
> Subject: [DynoMotion] Re: Kstep analog output
>
>
>  
> Thanks Tom.
>
> That's what I was afraid of. I thought about the relay output, but would have liked speed control.
>
> An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?
>
> If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
> with the motors i mention below.
>
> Kris
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> >
> > Hi Kris,
> >
> > No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.  That motor requires 50ma.  See:
> >
> >
> > http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
> >
> >
> > The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
> >
> > Regards
> > TK
> >
> >
> >
> >
> > ________________________________
> > From: chrismd500
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, January 24, 2013 1:48 PM
> > Subject: [DynoMotion] Kstep analog output
> >
> >
> >  
> > Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
> >
>
Group: DynoMotion Message: 6596 From: Tom Kerekes Date: 1/24/2013
Subject: Re: Kstep analog output
Hi Chris,

Yes you are using 7 of the 8 KFLOP Axis Channels.

Yes that DC driver should work.  You will need 3 pins from JP6. 

TK

Group: DynoMotion Message: 6598 From: chrismd500 Date: 1/24/2013
Subject: Re: Kstep analog output
Perfect. Thanks Tom

--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi Chris,
>
> Yes you are using 7 of the 8 KFLOP Axis Channels.
>
> Yes that DC driver should work.  You will need 3 pins from JP6. 
>
>
> TK
>
>
>
> ________________________________
> From: chrismd500
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, January 24, 2013 4:52 PM
> Subject: [DynoMotion] Re: Kstep analog output
>
>
>  
> Hi Tom,
>
> > So you are using 7 KFLOP motor axes already?
> Well, not sure how you define it, but I use 7 channels but "only" 5 mechanical axes as two of the axes use a slave motor each.
>
> kstep #1:
> ch0 + ch1(slave): Z
> ch2 + ch3(slave): tilt
>
> kstep #2:
> ch4: X
> ch5: Y
> ch6: sherline 3700 rotary
> ch7: none
>
> > You need 2 more motors for focus on 2 cameras?
> yes, two machine cameras with a Fujonon 16mm lens on each. http://www.fujifilmusa.com/products/optical_devices/machine-vision/2-3-5/hf16sa-1/
>
> That is a much better solution, I like that! So if I understand you correct that DC driver should work with kflop?
>
> Thanks,
> Kris
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> >
> > Hi Kris,
> >
> > So you are using 7 KFLOP motor axes already?  You need 2 more motors for focus on 2 cameras?
> >
> > But yes I like that device.   Like you mention I don't think it is a good idea to switch motor coils with a relay.  But that device has two motor drivers so I don't think you need to.  Just use two of KFLOP's PWM outputs to drive each of the motor drivers.   The KFLOP PWM Outputs are on JP6.  If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO pins.  One PWM for each motor and one common direction pin.  To control the speed just write a PWM value to the FPGA register.  You don't need to have to use a KFLOP Axis Channel for this.
> >
> > Regards
> > TK
> >
> >
> >
> >
> > ________________________________
> > From: chrismd500
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, January 24, 2013 3:34 PM
> > Subject: [DynoMotion] Re: Kstep analog output
> >
> >
> >  
> > Thanks Tom.
> >
> > That's what I was afraid of. I thought about the relay output, but would have liked speed control.
> >
> > An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?
> >
> > If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
> > with the motors i mention below.
> >
> > Kris
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > >
> > > Hi Kris,
> > >
> > > No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.  That motor requires 50ma.  See:
> > >
> > >
> > > http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
> > >
> > >
> > > The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > >
> > > ________________________________
> > > From: chrismd500
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, January 24, 2013 1:48 PM
> > > Subject: [DynoMotion] Kstep analog output
> > >
> > >
> > >  
> > > Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
> > >
> >
>
Group: DynoMotion Message: 6600 From: chrismd500 Date: 1/25/2013
Subject: Re: Kstep analog output
I looked at some of the KMotion C PWM examples, and I suppose it will be something like this (for 1st motor):

SetBitDirection(26,1); // IO 26 (motor 1) to output
FPGA(IO_PWMS_PRESCALE) = 1; // 65.08kHz/2 = 32.54kHz
FPGA(IO_PWMS+1) = 1; // enable PWM0 (@ IO 26)

For the direction bit, should I use for instance IO 27? so it would look like this:

SetBitDirection(27,1); // IO 27 (motor 1) to output
FPGA(IO_PWMS+3) = 1; // enable GPIO (@ IO 27)

To operate the motor:
FPGA(IO_PWMS+0) = x; // duty cycle. x = 0 (0%) to 255 (100%)
FPGA(IO_PWMS+2) = y; // y = 0 or 1, forward and reverse??

My other question is how do I control max voltage? If I set FPGA(IO_PWMS+0) = 255 the average output voltage would be equal to the motor supply voltage I assume. But let's say that my supply voltage is 12V and max motor voltage is 9V.

Thanks,
Kris

--- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
>
> Perfect. Thanks Tom
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> >
> > Hi Chris,
> >
> > Yes you are using 7 of the 8 KFLOP Axis Channels.
> >
> > Yes that DC driver should work.  You will need 3 pins from JP6. 
> >
> >
> > TK
> >
> >
> >
> > ________________________________
> > From: chrismd500
> > To: DynoMotion@yahoogroups.com
> > Sent: Thursday, January 24, 2013 4:52 PM
> > Subject: [DynoMotion] Re: Kstep analog output
> >
> >
> >  
> > Hi Tom,
> >
> > > So you are using 7 KFLOP motor axes already?
> > Well, not sure how you define it, but I use 7 channels but "only" 5 mechanical axes as two of the axes use a slave motor each.
> >
> > kstep #1:
> > ch0 + ch1(slave): Z
> > ch2 + ch3(slave): tilt
> >
> > kstep #2:
> > ch4: X
> > ch5: Y
> > ch6: sherline 3700 rotary
> > ch7: none
> >
> > > You need 2 more motors for focus on 2 cameras?
> > yes, two machine cameras with a Fujonon 16mm lens on each. http://www.fujifilmusa.com/products/optical_devices/machine-vision/2-3-5/hf16sa-1/
> >
> > That is a much better solution, I like that! So if I understand you correct that DC driver should work with kflop?
> >
> > Thanks,
> > Kris
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > >
> > > Hi Kris,
> > >
> > > So you are using 7 KFLOP motor axes already?  You need 2 more motors for focus on 2 cameras?
> > >
> > > But yes I like that device.   Like you mention I don't think it is a good idea to switch motor coils with a relay.  But that device has two motor drivers so I don't think you need to.  Just use two of KFLOP's PWM outputs to drive each of the motor drivers.   The KFLOP PWM Outputs are on JP6.  If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO pins.  One PWM for each motor and one common direction pin.  To control the speed just write a PWM value to the FPGA register.  You don't need to have to use a KFLOP Axis Channel for this.
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > >
> > > ________________________________
> > > From: chrismd500
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, January 24, 2013 3:34 PM
> > > Subject: [DynoMotion] Re: Kstep analog output
> > >
> > >
> > >  
> > > Thanks Tom.
> > >
> > > That's what I was afraid of. I thought about the relay output, but would have liked speed control.
> > >
> > > An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?
> > >
> > > If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
> > > with the motors i mention below.
> > >
> > > Kris
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > >
> > > > Hi Kris,
> > > >
> > > > No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.  That motor requires 50ma.  See:
> > > >
> > > >
> > > > http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
> > > >
> > > >
> > > > The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
> > > >
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: chrismd500
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, January 24, 2013 1:48 PM
> > > > Subject: [DynoMotion] Kstep analog output
> > > >
> > > >
> > > >  
> > > > Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
> > > >
> > >
> >
>
Group: DynoMotion Message: 6601 From: Tom Kerekes Date: 1/25/2013
Subject: Re: Kstep analog output
Hi Kris,

The simpler mode for that driver is just a direction signal and a PWM signal.  So you don't need a PWM signal for the direction.  Just use the pin as a General Purpose Output and set it high or clear it low for the direction.

PWM0 is used for the KSTEP analog Generator (It is multiplexed over to JP7).  So don't use PWM0 for your focus motor unles you never plan to use the Analog Output on KSTEP.

If the Max motor voltage is 9V and your supply is 12V then you should be careful to never set a PWM value greater than 9/12 x 255 = 191.  You might add a series resistor to be safe.  If the motor draws 50ma then to drop 3V would require a:

3V / 0.05A = 60 ohms  (power dissipated = 3V x 0.05A = 150mw)

Regards
TK

Group: DynoMotion Message: 6602 From: chrismd500 Date: 1/25/2013
Subject: Re: Kstep analog output
Ok, I see what you mean. So for the direction it would just be
SetBitDirection(IOxx,1) and use high/setbit and low/clearbit for the direction.

Thanks for the explanation on the voltage. I wasn't sure if there was a built-in function to scale the duty cycle elsewhere.

Thanks,
Kristoffer


--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi Kris,
>
> The simpler mode for that driver is just a direction signal and a PWM signal.  So you don't need a PWM signal for the direction.  Just use the pin as a General Purpose Output and set it high or clear it low for the direction.
>
> PWM0 is used for the KSTEP analog Generator (It is multiplexed over to JP7).  So don't use PWM0 for your focus motor unles you never plan to use the Analog Output on KSTEP.
>
>
> If the Max motor voltage is 9V and your supply is 12V then you should be careful to never set a PWM value greater than 9/12 x 255 = 191.  You might add a series resistor to be safe.  If the motor draws 50ma then to drop 3V would require a:
>
> 3V / 0.05A = 60 ohms  (power dissipated = 3V x 0.05A = 150mw)
>
> Regards
> TK
>
>
>
> ________________________________
> From: chrismd500
> To: DynoMotion@yahoogroups.com
> Sent: Friday, January 25, 2013 7:41 AM
> Subject: [DynoMotion] Re: Kstep analog output
>
>
>  
> I looked at some of the KMotion C PWM examples, and I suppose it will be something like this (for 1st motor):
>
> SetBitDirection(26,1); // IO 26 (motor 1) to output
> FPGA(IO_PWMS_PRESCALE) = 1; // 65.08kHz/2 = 32.54kHz
> FPGA(IO_PWMS+1) = 1; // enable PWM0 (@ IO 26)
>
> For the direction bit, should I use for instance IO 27? so it would look like this:
>
> SetBitDirection(27,1); // IO 27 (motor 1) to output
> FPGA(IO_PWMS+3) = 1; // enable GPIO (@ IO 27)
>
> To operate the motor:
> FPGA(IO_PWMS+0) = x; // duty cycle. x = 0 (0%) to 255 (100%)
> FPGA(IO_PWMS+2) = y; // y = 0 or 1, forward and reverse??
>
> My other question is how do I control max voltage? If I set FPGA(IO_PWMS+0) = 255 the average output voltage would be equal to the motor supply voltage I assume. But let's say that my supply voltage is 12V and max motor voltage is 9V.
>
> Thanks,
> Kris
>
> --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
> >
> > Perfect. Thanks Tom
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > >
> > > Hi Chris,
> > >
> > > Yes you are using 7 of the 8 KFLOP Axis Channels.
> > >
> > > Yes that DC driver should work.  You will need 3 pins from JP6. 
> > >
> > >
> > > TK
> > >
> > >
> > >
> > > ________________________________
> > > From: chrismd500
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Thursday, January 24, 2013 4:52 PM
> > > Subject: [DynoMotion] Re: Kstep analog output
> > >
> > >
> > >  
> > > Hi Tom,
> > >
> > > > So you are using 7 KFLOP motor axes already?
> > > Well, not sure how you define it, but I use 7 channels but "only" 5 mechanical axes as two of the axes use a slave motor each.
> > >
> > > kstep #1:
> > > ch0 + ch1(slave): Z
> > > ch2 + ch3(slave): tilt
> > >
> > > kstep #2:
> > > ch4: X
> > > ch5: Y
> > > ch6: sherline 3700 rotary
> > > ch7: none
> > >
> > > > You need 2 more motors for focus on 2 cameras?
> > > yes, two machine cameras with a Fujonon 16mm lens on each. http://www.fujifilmusa.com/products/optical_devices/machine-vision/2-3-5/hf16sa-1/
> > >
> > > That is a much better solution, I like that! So if I understand you correct that DC driver should work with kflop?
> > >
> > > Thanks,
> > > Kris
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > >
> > > > Hi Kris,
> > > >
> > > > So you are using 7 KFLOP motor axes already?  You need 2 more motors for focus on 2 cameras?
> > > >
> > > > But yes I like that device.   Like you mention I don't think it is a good idea to switch motor coils with a relay.  But that device has two motor drivers so I don't think you need to.  Just use two of KFLOP's PWM outputs to drive each of the motor drivers.   The KFLOP PWM Outputs are on JP6.  If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO pins.  One PWM for each motor and one common direction pin.  To control the speed just write a PWM value to the FPGA register.  You don't need to have to use a KFLOP Axis Channel for this.
> > > >
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: chrismd500
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, January 24, 2013 3:34 PM
> > > > Subject: [DynoMotion] Re: Kstep analog output
> > > >
> > > >
> > > >  
> > > > Thanks Tom.
> > > >
> > > > That's what I was afraid of. I thought about the relay output, but would have liked speed control.
> > > >
> > > > An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?
> > > >
> > > > If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
> > > > with the motors i mention below.
> > > >
> > > > Kris
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > >
> > > > > Hi Kris,
> > > > >
> > > > > No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.ÃÆ'‚  That motor requires 50ma.ÃÆ'‚  See:
> > > > >
> > > > >
> > > > > http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
> > > > >
> > > > >
> > > > > The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.ÃÆ'‚  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
> > > > >
> > > > > Regards
> > > > > TK
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > > From: chrismd500
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, January 24, 2013 1:48 PM
> > > > > Subject: [DynoMotion] Kstep analog output
> > > > >
> > > > >
> > > > > ÃÆ'‚ 
> > > > > Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 6647 From: chrismd500 Date: 2/4/2013
Subject: Re: Kstep analog output
Tom,

I received the boards today, kflop seems to work perfectly (i haven't used the ksteps yet).

I have a couple of questions regarding to PWM. I've connected the driver board from Pololu http://www.pololu.com/catalog/product/2135, and it works good except one issue.

The kflop get power from the USB, and the Pololu driver board get the logical and motor power from a 5v power supply (that I also use for logical power for both my ksteps). I've only connected kflop JP6 IO 27 (pwm1), 28 (pwm2), and 29 (direction) to the Pololu driver 4 inputs.

What I see is that there is a slight voltage difference (~0.3V) between the USB ground and the 5V power supply ground, so the motors start turning very slowly as soon as i plug in the USB in kflop. When I set IO 29 (direction) to high, the motors stop, when I put it back to low they start turning again.

So my question is, should I connect the USB ground with the 5V power supply ground? I'm also considering to use the kflop power for the logical power on the Pololu driver (and use the 5v power supply for the pololu board motor power and kstep logical power). If I do that, will kflop and kstep still be opto-isolated?

The next question is; how do I issue the "FPGA(IO_PWMS+x) = yy" via WriteLine in C++? In the manual it says it should be FPGAzzzz yy, where I assume zzzz = IO_PWMS+x. But I cannot find the numerical value of IO_PWMS.

Thanks,
Kristoffer

--- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
>
> Ok, I see what you mean. So for the direction it would just be
> SetBitDirection(IOxx,1) and use high/setbit and low/clearbit for the direction.
>
> Thanks for the explanation on the voltage. I wasn't sure if there was a built-in function to scale the duty cycle elsewhere.
>
> Thanks,
> Kristoffer
>
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> >
> > Hi Kris,
> >
> > The simpler mode for that driver is just a direction signal and a PWM signal.  So you don't need a PWM signal for the direction.  Just use the pin as a General Purpose Output and set it high or clear it low for the direction.
> >
> > PWM0 is used for the KSTEP analog Generator (It is multiplexed over to JP7).  So don't use PWM0 for your focus motor unles you never plan to use the Analog Output on KSTEP.
> >
> >
> > If the Max motor voltage is 9V and your supply is 12V then you should be careful to never set a PWM value greater than 9/12 x 255 = 191.  You might add a series resistor to be safe.  If the motor draws 50ma then to drop 3V would require a:
> >
> > 3V / 0.05A = 60 ohms  (power dissipated = 3V x 0.05A = 150mw)
> >
> > Regards
> > TK
> >
> >
> >
> > ________________________________
> > From: chrismd500
> > To: DynoMotion@yahoogroups.com
> > Sent: Friday, January 25, 2013 7:41 AM
> > Subject: [DynoMotion] Re: Kstep analog output
> >
> >
> >  
> > I looked at some of the KMotion C PWM examples, and I suppose it will be something like this (for 1st motor):
> >
> > SetBitDirection(26,1); // IO 26 (motor 1) to output
> > FPGA(IO_PWMS_PRESCALE) = 1; // 65.08kHz/2 = 32.54kHz
> > FPGA(IO_PWMS+1) = 1; // enable PWM0 (@ IO 26)
> >
> > For the direction bit, should I use for instance IO 27? so it would look like this:
> >
> > SetBitDirection(27,1); // IO 27 (motor 1) to output
> > FPGA(IO_PWMS+3) = 1; // enable GPIO (@ IO 27)
> >
> > To operate the motor:
> > FPGA(IO_PWMS+0) = x; // duty cycle. x = 0 (0%) to 255 (100%)
> > FPGA(IO_PWMS+2) = y; // y = 0 or 1, forward and reverse??
> >
> > My other question is how do I control max voltage? If I set FPGA(IO_PWMS+0) = 255 the average output voltage would be equal to the motor supply voltage I assume. But let's say that my supply voltage is 12V and max motor voltage is 9V.
> >
> > Thanks,
> > Kris
> >
> > --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
> > >
> > > Perfect. Thanks Tom
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > >
> > > > Hi Chris,
> > > >
> > > > Yes you are using 7 of the 8 KFLOP Axis Channels.
> > > >
> > > > Yes that DC driver should work.  You will need 3 pins from JP6. 
> > > >
> > > >
> > > > TK
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: chrismd500
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Thursday, January 24, 2013 4:52 PM
> > > > Subject: [DynoMotion] Re: Kstep analog output
> > > >
> > > >
> > > >  
> > > > Hi Tom,
> > > >
> > > > > So you are using 7 KFLOP motor axes already?
> > > > Well, not sure how you define it, but I use 7 channels but "only" 5 mechanical axes as two of the axes use a slave motor each.
> > > >
> > > > kstep #1:
> > > > ch0 + ch1(slave): Z
> > > > ch2 + ch3(slave): tilt
> > > >
> > > > kstep #2:
> > > > ch4: X
> > > > ch5: Y
> > > > ch6: sherline 3700 rotary
> > > > ch7: none
> > > >
> > > > > You need 2 more motors for focus on 2 cameras?
> > > > yes, two machine cameras with a Fujonon 16mm lens on each. http://www.fujifilmusa.com/products/optical_devices/machine-vision/2-3-5/hf16sa-1/
> > > >
> > > > That is a much better solution, I like that! So if I understand you correct that DC driver should work with kflop?
> > > >
> > > > Thanks,
> > > > Kris
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > >
> > > > > Hi Kris,
> > > > >
> > > > > So you are using 7 KFLOP motor axes already?  You need 2 more motors for focus on 2 cameras?
> > > > >
> > > > > But yes I like that device.   Like you mention I don't think it is a good idea to switch motor coils with a relay.  But that device has two motor drivers so I don't think you need to.  Just use two of KFLOP's PWM outputs to drive each of the motor drivers.   The KFLOP PWM Outputs are on JP6.  If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO pins.  One PWM for each motor and one common direction pin.  To control the speed just write a PWM value to the FPGA register.  You don't need to have to use a KFLOP Axis Channel for this.
> > > > >
> > > > > Regards
> > > > > TK
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > > From: chrismd500
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, January 24, 2013 3:34 PM
> > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > >
> > > > >
> > > > >  
> > > > > Thanks Tom.
> > > > >
> > > > > That's what I was afraid of. I thought about the relay output, but would have liked speed control.
> > > > >
> > > > > An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?
> > > > >
> > > > > If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
> > > > > with the motors i mention below.
> > > > >
> > > > > Kris
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > >
> > > > > > Hi Kris,
> > > > > >
> > > > > > No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.ÃÆ'‚  That motor requires 50ma.ÃÆ'‚  See:
> > > > > >
> > > > > >
> > > > > > http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
> > > > > >
> > > > > >
> > > > > > The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.ÃÆ'‚  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
> > > > > >
> > > > > > Regards
> > > > > > TK
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > > From: chrismd500
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Sent: Thursday, January 24, 2013 1:48 PM
> > > > > > Subject: [DynoMotion] Kstep analog output
> > > > > >
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > > Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
> > > > > >
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 6648 From: Tom Kerekes Date: 2/4/2013
Subject: Re: Kstep analog output
Hi Kris,

Yes you absolutely need a common GND connection between KFLOP and the Pololu Driver.  KFLOP outputs highs and lows relative to that GND reference, and the Pololu Driver looks for highs and lows relative to that same GND reference.

I would use the +5V and GND from KFLOP JP6 connected to the Pololu Driver regardless of how KFLOP is powered..  It should require very little logic power.

And yes if you connected the GND to all 3 things (KSTEPS, KFLOP, and the Pololu Driver) you would defeat the KSTEP isolation feature.  So don't do that.  Use the +5V supply for only the KSTEPS.

The FPGA register symbols are defined in the KMotionDef.h file as:

#define IO_PWMS 0xD0              // FPGA offset to IO PWM registers (2 bytes each - value, enable(bit0))

The FPGA script command uses decimal values so that would be 208.   PWM #1 would be at offset 2 and 3.  So 210 and 211 decimal.

HTH
Regards
TK

Group: DynoMotion Message: 6649 From: chrismd500 Date: 2/4/2013
Subject: Re: Kstep analog output
Thanks Tom.
If I keep the 5V supply for the ksteps only, I probably need another 5v supply. The motors draw a maximum of 300mA/each. I will only operate one motor at a time.

But to avoid having another 5v supply could I use a USB 2.0 y-cable to achieve 1A using two USB 2.0 ports? It's common to use that to speed up charging on some phones and tablets. Or do kflop limit to 0.5A via USB?

--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi Kris,
>
> Yes you absolutely need a common GND connection between KFLOP and the Pololu Driver.  KFLOP outputs highs and lows relative to that GND reference, and the Pololu Driver looks for highs and lows relative to that same GND reference.
>
>
> I would use the +5V and GND from KFLOP JP6 connected to the Pololu Driver regardless of how KFLOP is powered..  It should require very little logic power.
>
> And yes if you connected the GND to all 3 things (KSTEPS, KFLOP, and the Pololu Driver) you would defeat the KSTEP isolation feature.  So don't do that.  Use the +5V supply for only the KSTEPS.
>
> The FPGA register symbols are defined in the KMotionDef.h file as:
>
> #define IO_PWMS 0xD0              // FPGA offset to IO PWM registers (2 bytes each - value, enable(bit0))
>
>
> The FPGA script command uses decimal values so that would be 208.   PWM #1 would be at offset 2 and 3.  So 210 and 211 decimal.
>
> HTH
> Regards
> TK
>
>
>
> ________________________________
> From: chrismd500
> To: DynoMotion@yahoogroups.com
> Sent: Monday, February 4, 2013 6:12 PM
> Subject: [DynoMotion] Re: Kstep analog output
>
>
>  
> Tom,
>
> I received the boards today, kflop seems to work perfectly (i haven't used the ksteps yet).
>
> I have a couple of questions regarding to PWM. I've connected the driver board from Pololu http://www.pololu.com/catalog/product/2135, and it works good except one issue.
>
> The kflop get power from the USB, and the Pololu driver board get the logical and motor power from a 5v power supply (that I also use for logical power for both my ksteps). I've only connected kflop JP6 IO 27 (pwm1), 28 (pwm2), and 29 (direction) to the Pololu driver 4 inputs.
>
> What I see is that there is a slight voltage difference (~0.3V) between the USB ground and the 5V power supply ground, so the motors start turning very slowly as soon as i plug in the USB in kflop. When I set IO 29 (direction) to high, the motors stop, when I put it back to low they start turning again.
>
> So my question is, should I connect the USB ground with the 5V power supply ground? I'm also considering to use the kflop power for the logical power on the Pololu driver (and use the 5v power supply for the pololu board motor power and kstep logical power). If I do that, will kflop and kstep still be opto-isolated?
>
> The next question is; how do I issue the "FPGA(IO_PWMS+x) = yy" via WriteLine in C++? In the manual it says it should be FPGAzzzz yy, where I assume zzzz = IO_PWMS+x. But I cannot find the numerical value of IO_PWMS.
>
> Thanks,
> Kristoffer
>
> --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
> >
> > Ok, I see what you mean. So for the direction it would just be
> > SetBitDirection(IOxx,1) and use high/setbit and low/clearbit for the direction.
> >
> > Thanks for the explanation on the voltage. I wasn't sure if there was a built-in function to scale the duty cycle elsewhere.
> >
> > Thanks,
> > Kristoffer
> >
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > >
> > > Hi Kris,
> > >
> > > The simpler mode for that driver is just a direction signal and a PWM signal.  So you don't need a PWM signal for the direction.  Just use the pin as a General Purpose Output and set it high or clear it low for the direction.
> > >
> > > PWM0 is used for the KSTEP analog Generator (It is multiplexed over to JP7).  So don't use PWM0 for your focus motor unles you never plan to use the Analog Output on KSTEP.
> > >
> > >
> > > If the Max motor voltage is 9V and your supply is 12V then you should be careful to never set a PWM value greater than 9/12 x 255 = 191.  You might add a series resistor to be safe.  If the motor draws 50ma then to drop 3V would require a:
> > >
> > > 3V / 0.05A = 60 ohms  (power dissipated = 3V x 0.05A = 150mw)
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > > ________________________________
> > > From: chrismd500
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Friday, January 25, 2013 7:41 AM
> > > Subject: [DynoMotion] Re: Kstep analog output
> > >
> > >
> > >  
> > > I looked at some of the KMotion C PWM examples, and I suppose it will be something like this (for 1st motor):
> > >
> > > SetBitDirection(26,1); // IO 26 (motor 1) to output
> > > FPGA(IO_PWMS_PRESCALE) = 1; // 65.08kHz/2 = 32.54kHz
> > > FPGA(IO_PWMS+1) = 1; // enable PWM0 (@ IO 26)
> > >
> > > For the direction bit, should I use for instance IO 27? so it would look like this:
> > >
> > > SetBitDirection(27,1); // IO 27 (motor 1) to output
> > > FPGA(IO_PWMS+3) = 1; // enable GPIO (@ IO 27)
> > >
> > > To operate the motor:
> > > FPGA(IO_PWMS+0) = x; // duty cycle. x = 0 (0%) to 255 (100%)
> > > FPGA(IO_PWMS+2) = y; // y = 0 or 1, forward and reverse??
> > >
> > > My other question is how do I control max voltage? If I set FPGA(IO_PWMS+0) = 255 the average output voltage would be equal to the motor supply voltage I assume. But let's say that my supply voltage is 12V and max motor voltage is 9V.
> > >
> > > Thanks,
> > > Kris
> > >
> > > --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
> > > >
> > > > Perfect. Thanks Tom
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > >
> > > > > Hi Chris,
> > > > >
> > > > > Yes you are using 7 of the 8 KFLOP Axis Channels.
> > > > >
> > > > > Yes that DC driver should work.  You will need 3 pins from JP6. 
> > > > >
> > > > >
> > > > > TK
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > > From: chrismd500
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Thursday, January 24, 2013 4:52 PM
> > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > >
> > > > >
> > > > >  
> > > > > Hi Tom,
> > > > >
> > > > > > So you are using 7 KFLOP motor axes already?
> > > > > Well, not sure how you define it, but I use 7 channels but "only" 5 mechanical axes as two of the axes use a slave motor each.
> > > > >
> > > > > kstep #1:
> > > > > ch0 + ch1(slave): Z
> > > > > ch2 + ch3(slave): tilt
> > > > >
> > > > > kstep #2:
> > > > > ch4: X
> > > > > ch5: Y
> > > > > ch6: sherline 3700 rotary
> > > > > ch7: none
> > > > >
> > > > > > You need 2 more motors for focus on 2 cameras?
> > > > > yes, two machine cameras with a Fujonon 16mm lens on each. http://www.fujifilmusa.com/products/optical_devices/machine-vision/2-3-5/hf16sa-1/
> > > > >
> > > > > That is a much better solution, I like that! So if I understand you correct that DC driver should work with kflop?
> > > > >
> > > > > Thanks,
> > > > > Kris
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > >
> > > > > > Hi Kris,
> > > > > >
> > > > > > So you are using 7 KFLOP motor axes already?ÃÆ'‚  You need 2 more motors for focus on 2 cameras?
> > > > > >
> > > > > > But yes I like that device.ÃÆ'‚ ÃÆ'‚  Like you mention I don't think it is a good idea to switch motor coils with a relay.ÃÆ'‚  But that device has two motor drivers so I don't think you need to.ÃÆ'‚  Just use two of KFLOP's PWM outputs to drive each of the motor drivers. ÃÆ'‚  The KFLOP PWM Outputs are on JP6.ÃÆ'‚  If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO pins.ÃÆ'‚  One PWM for each motor and one common direction pin.ÃÆ'‚  To control the speed just write a PWM value to the FPGA register.ÃÆ'‚  You don't need to have to use a KFLOP Axis Channel for this.
> > > > > >
> > > > > > Regards
> > > > > > TK
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > > From: chrismd500
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Sent: Thursday, January 24, 2013 3:34 PM
> > > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > > >
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > > Thanks Tom.
> > > > > >
> > > > > > That's what I was afraid of. I thought about the relay output, but would have liked speed control.
> > > > > >
> > > > > > An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?
> > > > > >
> > > > > > If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
> > > > > > with the motors i mention below.
> > > > > >
> > > > > > Kris
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > > >
> > > > > > > Hi Kris,
> > > > > > >
> > > > > > > No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.ÃÆ'Æ'‚ÃÆ'‚  That motor requires 50ma.ÃÆ'Æ'‚ÃÆ'‚  See:
> > > > > > >
> > > > > > >
> > > > > > > http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
> > > > > > >
> > > > > > >
> > > > > > > The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.ÃÆ'Æ'‚ÃÆ'‚  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
> > > > > > >
> > > > > > > Regards
> > > > > > > TK
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ________________________________
> > > > > > > From: chrismd500
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Sent: Thursday, January 24, 2013 1:48 PM
> > > > > > > Subject: [DynoMotion] Kstep analog output
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 6650 From: Tom Kerekes Date: 2/4/2013
Subject: Re: Kstep analog output
Hi Kris,

I would use a separate supply for the motor side of the driver and not USB power.

Regards
TK

Group: DynoMotion Message: 6654 From: chrismd500 Date: 2/5/2013
Subject: Re: Kstep analog output
Ok, I'll add another 5v supply.

I just want to make sure I got the grounding of the enclosure correct. Before I installed the Pololu driver the enclosure was grounded through the 5V ground (V-) which share the 24V motor power ground. The kflop was floating using the USB power. Was that the right way to do it? When I now add the Pololu driver and another 5V supply, those will be floating together with the kflop if I keep it as I had before.

--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi Kris,
>
> I would use a separate supply for the motor side of the driver and not USB power.
>
> Regards
> TK
>
>
>
> ________________________________
> From: chrismd500
> To: DynoMotion@yahoogroups.com
> Sent: Monday, February 4, 2013 7:46 PM
> Subject: [DynoMotion] Re: Kstep analog output
>
>
>  
> Thanks Tom.
> If I keep the 5V supply for the ksteps only, I probably need another 5v supply. The motors draw a maximum of 300mA/each. I will only operate one motor at a time.
>
> But to avoid having another 5v supply could I use a USB 2.0 y-cable to achieve 1A using two USB 2.0 ports? It's common to use that to speed up charging on some phones and tablets. Or do kflop limit to 0.5A via USB?
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> >
> > Hi Kris,
> >
> > Yes you absolutely need a common GND connection between KFLOP and the Pololu Driver.  KFLOP outputs highs and lows relative to that GND reference, and the Pololu Driver looks for highs and lows relative to that same GND reference.
> >
> >
> > I would use the +5V and GND from KFLOP JP6 connected to the Pololu Driver regardless of how KFLOP is powered..  It should require very little logic power.
> >
> > And yes if you connected the GND to all 3 things (KSTEPS, KFLOP, and the Pololu Driver) you would defeat the KSTEP isolation feature.  So don't do that.  Use the +5V supply for only the KSTEPS.
> >
> > The FPGA register symbols are defined in the KMotionDef.h file as:
> >
> > #define IO_PWMS 0xD0              // FPGA offset to IO PWM registers (2 bytes each - value, enable(bit0))
> >
> >
> > The FPGA script command uses decimal values so that would be 208.   PWM #1 would be at offset 2 and 3.  So 210 and 211 decimal.
> >
> > HTH
> > Regards
> > TK
> >
> >
> >
> > ________________________________
> > From: chrismd500
> > To: DynoMotion@yahoogroups.com
> > Sent: Monday, February 4, 2013 6:12 PM
> > Subject: [DynoMotion] Re: Kstep analog output
> >
> >
> >  
> > Tom,
> >
> > I received the boards today, kflop seems to work perfectly (i haven't used the ksteps yet).
> >
> > I have a couple of questions regarding to PWM. I've connected the driver board from Pololu http://www.pololu.com/catalog/product/2135, and it works good except one issue.
> >
> > The kflop get power from the USB, and the Pololu driver board get the logical and motor power from a 5v power supply (that I also use for logical power for both my ksteps). I've only connected kflop JP6 IO 27 (pwm1), 28 (pwm2), and 29 (direction) to the Pololu driver 4 inputs.
> >
> > What I see is that there is a slight voltage difference (~0.3V) between the USB ground and the 5V power supply ground, so the motors start turning very slowly as soon as i plug in the USB in kflop. When I set IO 29 (direction) to high, the motors stop, when I put it back to low they start turning again.
> >
> > So my question is, should I connect the USB ground with the 5V power supply ground? I'm also considering to use the kflop power for the logical power on the Pololu driver (and use the 5v power supply for the pololu board motor power and kstep logical power). If I do that, will kflop and kstep still be opto-isolated?
> >
> > The next question is; how do I issue the "FPGA(IO_PWMS+x) = yy" via WriteLine in C++? In the manual it says it should be FPGAzzzz yy, where I assume zzzz = IO_PWMS+x. But I cannot find the numerical value of IO_PWMS.
> >
> > Thanks,
> > Kristoffer
> >
> > --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
> > >
> > > Ok, I see what you mean. So for the direction it would just be
> > > SetBitDirection(IOxx,1) and use high/setbit and low/clearbit for the direction.
> > >
> > > Thanks for the explanation on the voltage. I wasn't sure if there was a built-in function to scale the duty cycle elsewhere.
> > >
> > > Thanks,
> > > Kristoffer
> > >
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > >
> > > > Hi Kris,
> > > >
> > > > The simpler mode for that driver is just a direction signal and a PWM signal.  So you don't need a PWM signal for the direction.  Just use the pin as a General Purpose Output and set it high or clear it low for the direction.
> > > >
> > > > PWM0 is used for the KSTEP analog Generator (It is multiplexed over to JP7).  So don't use PWM0 for your focus motor unles you never plan to use the Analog Output on KSTEP.
> > > >
> > > >
> > > > If the Max motor voltage is 9V and your supply is 12V then you should be careful to never set a PWM value greater than 9/12 x 255 = 191.  You might add a series resistor to be safe.  If the motor draws 50ma then to drop 3V would require a:
> > > >
> > > > 3V / 0.05A = 60 ohms  (power dissipated = 3V x 0.05A = 150mw)
> > > >
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: chrismd500
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Friday, January 25, 2013 7:41 AM
> > > > Subject: [DynoMotion] Re: Kstep analog output
> > > >
> > > >
> > > >  
> > > > I looked at some of the KMotion C PWM examples, and I suppose it will be something like this (for 1st motor):
> > > >
> > > > SetBitDirection(26,1); // IO 26 (motor 1) to output
> > > > FPGA(IO_PWMS_PRESCALE) = 1; // 65.08kHz/2 = 32.54kHz
> > > > FPGA(IO_PWMS+1) = 1; // enable PWM0 (@ IO 26)
> > > >
> > > > For the direction bit, should I use for instance IO 27? so it would look like this:
> > > >
> > > > SetBitDirection(27,1); // IO 27 (motor 1) to output
> > > > FPGA(IO_PWMS+3) = 1; // enable GPIO (@ IO 27)
> > > >
> > > > To operate the motor:
> > > > FPGA(IO_PWMS+0) = x; // duty cycle. x = 0 (0%) to 255 (100%)
> > > > FPGA(IO_PWMS+2) = y; // y = 0 or 1, forward and reverse??
> > > >
> > > > My other question is how do I control max voltage? If I set FPGA(IO_PWMS+0) = 255 the average output voltage would be equal to the motor supply voltage I assume. But let's say that my supply voltage is 12V and max motor voltage is 9V.
> > > >
> > > > Thanks,
> > > > Kris
> > > >
> > > > --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
> > > > >
> > > > > Perfect. Thanks Tom
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > >
> > > > > > Hi Chris,
> > > > > >
> > > > > > Yes you are using 7 of the 8 KFLOP Axis Channels.
> > > > > >
> > > > > > Yes that DC driver should work.ÃÆ'‚  You will need 3 pins from JP6.ÃÆ'‚ 
> > > > > >
> > > > > >
> > > > > > TK
> > > > > >
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > > From: chrismd500
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Sent: Thursday, January 24, 2013 4:52 PM
> > > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > > >
> > > > > >
> > > > > > ÃÆ'‚ 
> > > > > > Hi Tom,
> > > > > >
> > > > > > > So you are using 7 KFLOP motor axes already?
> > > > > > Well, not sure how you define it, but I use 7 channels but "only" 5 mechanical axes as two of the axes use a slave motor each.
> > > > > >
> > > > > > kstep #1:
> > > > > > ch0 + ch1(slave): Z
> > > > > > ch2 + ch3(slave): tilt
> > > > > >
> > > > > > kstep #2:
> > > > > > ch4: X
> > > > > > ch5: Y
> > > > > > ch6: sherline 3700 rotary
> > > > > > ch7: none
> > > > > >
> > > > > > > You need 2 more motors for focus on 2 cameras?
> > > > > > yes, two machine cameras with a Fujonon 16mm lens on each. http://www.fujifilmusa.com/products/optical_devices/machine-vision/2-3-5/hf16sa-1/
> > > > > >
> > > > > > That is a much better solution, I like that! So if I understand you correct that DC driver should work with kflop?
> > > > > >
> > > > > > Thanks,
> > > > > > Kris
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > > >
> > > > > > > Hi Kris,
> > > > > > >
> > > > > > > So you are using 7 KFLOP motor axes already?ÃÆ'Æ'‚ÃÆ'‚  You need 2 more motors for focus on 2 cameras?
> > > > > > >
> > > > > > > But yes I like that device.ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'‚ÃÆ'‚  Like you mention I don't think it is a good idea to switch motor coils with a relay.ÃÆ'Æ'‚ÃÆ'‚  But that device has two motor drivers so I don't think you need to.ÃÆ'Æ'‚ÃÆ'‚  Just use two of KFLOP's PWM outputs to drive each of the motor drivers. ÃÆ'Æ'‚ÃÆ'‚  The KFLOP PWM Outputs are on JP6.ÃÆ'Æ'‚ÃÆ'‚  If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO pins.ÃÆ'Æ'‚ÃÆ'‚  One PWM for each motor and one common direction pin.ÃÆ'Æ'‚ÃÆ'‚  To control the speed just write a PWM value to the FPGA register.ÃÆ'Æ'‚ÃÆ'‚  You don't need to have to use a KFLOP Axis Channel
> for this.
> > > > > > >
> > > > > > > Regards
> > > > > > > TK
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ________________________________
> > > > > > > From: chrismd500
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Sent: Thursday, January 24, 2013 3:34 PM
> > > > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Thanks Tom.
> > > > > > >
> > > > > > > That's what I was afraid of. I thought about the relay output, but would have liked speed control.
> > > > > > >
> > > > > > > An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?
> > > > > > >
> > > > > > > If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
> > > > > > > with the motors i mention below.
> > > > > > >
> > > > > > > Kris
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > > > >
> > > > > > > > Hi Kris,
> > > > > > > >
> > > > > > > > No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  That motor requires 50ma.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  See:
> > > > > > > >
> > > > > > > >
> > > > > > > > http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
> > > > > > > >
> > > > > > > >
> > > > > > > > The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
> > > > > > > >
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > ________________________________
> > > > > > > > From: chrismd500
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Sent: Thursday, January 24, 2013 1:48 PM
> > > > > > > > Subject: [DynoMotion] Kstep analog output
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 6655 From: Tom Kerekes Date: 2/5/2013
Subject: Re: Kstep analog output
Hi Kris,

I'm not sure I understand this.   But the enclosure should probably go to earth ground not any of the DC grounds.

Regards
TK

Group: DynoMotion Message: 6656 From: chrismd500 Date: 2/5/2013
Subject: Re: Kstep analog output
Tom,

Ok so I guess it was good I asked this question then.

I'm using this DC barrel jack for http://www.radioshack.com/product/index.jsp?productId=2102486. it's not insulated on the enclosure, so the DC ground will go into the enclosure, which probably is wrong.

I think I'm a little confused on earth ground and DC ground. I'm sorry, this is basic stuff that I probably should have know already. I did some research on the internet when I installed that jack, and it seemed to be so many different opinions on how to ground stuff, some people grounding to 0V and others not, so I assumed using the DC ground would be fine.

So I guess what you are saying is to insulate the enclosure from the boards, and use earth ground instead? Where do I get earth ground from?

--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi Kris,
>
> I'm not sure I understand this.   But the enclosure should probably go to earth ground not any of the DC grounds.
>
> Regards
> TK
>
>
>
>
> ________________________________
> From: chrismd500
> To: DynoMotion@yahoogroups.com
> Sent: Tuesday, February 5, 2013 4:29 AM
> Subject: [DynoMotion] Re: Kstep analog output
>
>
>  
> Ok, I'll add another 5v supply.
>
> I just want to make sure I got the grounding of the enclosure correct. Before I installed the Pololu driver the enclosure was grounded through the 5V ground (V-) which share the 24V motor power ground. The kflop was floating using the USB power. Was that the right way to do it? When I now add the Pololu driver and another 5V supply, those will be floating together with the kflop if I keep it as I had before.
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> >
> > Hi Kris,
> >
> > I would use a separate supply for the motor side of the driver and not USB power.
> >
> > Regards
> > TK
> >
> >
> >
> > ________________________________
> > From: chrismd500
> > To: DynoMotion@yahoogroups.com
> > Sent: Monday, February 4, 2013 7:46 PM
> > Subject: [DynoMotion] Re: Kstep analog output
> >
> >
> >  
> > Thanks Tom.
> > If I keep the 5V supply for the ksteps only, I probably need another 5v supply. The motors draw a maximum of 300mA/each. I will only operate one motor at a time.
> >
> > But to avoid having another 5v supply could I use a USB 2.0 y-cable to achieve 1A using two USB 2.0 ports? It's common to use that to speed up charging on some phones and tablets. Or do kflop limit to 0.5A via USB?
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > >
> > > Hi Kris,
> > >
> > > Yes you absolutely need a common GND connection between KFLOP and the Pololu Driver.  KFLOP outputs highs and lows relative to that GND reference, and the Pololu Driver looks for highs and lows relative to that same GND reference.
> > >
> > >
> > > I would use the +5V and GND from KFLOP JP6 connected to the Pololu Driver regardless of how KFLOP is powered..  It should require very little logic power.
> > >
> > > And yes if you connected the GND to all 3 things (KSTEPS, KFLOP, and the Pololu Driver) you would defeat the KSTEP isolation feature.  So don't do that.  Use the +5V supply for only the KSTEPS.
> > >
> > > The FPGA register symbols are defined in the KMotionDef.h file as:
> > >
> > > #define IO_PWMS 0xD0              // FPGA offset to IO PWM registers (2 bytes each - value, enable(bit0))
> > >
> > >
> > > The FPGA script command uses decimal values so that would be 208.   PWM #1 would be at offset 2 and 3.  So 210 and 211 decimal.
> > >
> > > HTH
> > > Regards
> > > TK
> > >
> > >
> > >
> > > ________________________________
> > > From: chrismd500
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Monday, February 4, 2013 6:12 PM
> > > Subject: [DynoMotion] Re: Kstep analog output
> > >
> > >
> > >  
> > > Tom,
> > >
> > > I received the boards today, kflop seems to work perfectly (i haven't used the ksteps yet).
> > >
> > > I have a couple of questions regarding to PWM. I've connected the driver board from Pololu http://www.pololu.com/catalog/product/2135, and it works good except one issue.
> > >
> > > The kflop get power from the USB, and the Pololu driver board get the logical and motor power from a 5v power supply (that I also use for logical power for both my ksteps). I've only connected kflop JP6 IO 27 (pwm1), 28 (pwm2), and 29 (direction) to the Pololu driver 4 inputs.
> > >
> > > What I see is that there is a slight voltage difference (~0.3V) between the USB ground and the 5V power supply ground, so the motors start turning very slowly as soon as i plug in the USB in kflop. When I set IO 29 (direction) to high, the motors stop, when I put it back to low they start turning again.
> > >
> > > So my question is, should I connect the USB ground with the 5V power supply ground? I'm also considering to use the kflop power for the logical power on the Pololu driver (and use the 5v power supply for the pololu board motor power and kstep logical power). If I do that, will kflop and kstep still be opto-isolated?
> > >
> > > The next question is; how do I issue the "FPGA(IO_PWMS+x) = yy" via WriteLine in C++? In the manual it says it should be FPGAzzzz yy, where I assume zzzz = IO_PWMS+x. But I cannot find the numerical value of IO_PWMS.
> > >
> > > Thanks,
> > > Kristoffer
> > >
> > > --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
> > > >
> > > > Ok, I see what you mean. So for the direction it would just be
> > > > SetBitDirection(IOxx,1) and use high/setbit and low/clearbit for the direction.
> > > >
> > > > Thanks for the explanation on the voltage. I wasn't sure if there was a built-in function to scale the duty cycle elsewhere.
> > > >
> > > > Thanks,
> > > > Kristoffer
> > > >
> > > >
> > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > >
> > > > > Hi Kris,
> > > > >
> > > > > The simpler mode for that driver is just a direction signal and a PWM signal.ÃÆ'‚  So you don't need a PWM signal for the direction.ÃÆ'‚  Just use the pin as a General Purpose Output and set it high or clear it low for the direction.
> > > > >
> > > > > PWM0 is used for the KSTEP analog Generator (It is multiplexed over to JP7).ÃÆ'‚  So don't use PWM0 for your focus motor unles you never plan to use the Analog Output on KSTEP.
> > > > >
> > > > >
> > > > > If the Max motor voltage is 9V and your supply is 12V then you should be careful to never set a PWM value greater than 9/12 x 255 = 191.ÃÆ'‚  You might add a series resistor to be safe.ÃÆ'‚  If the motor draws 50ma then to drop 3V would require a:
> > > > >
> > > > > 3V / 0.05A = 60 ohmsÃÆ'‚  (power dissipated = 3V x 0.05A = 150mw)
> > > > >
> > > > > Regards
> > > > > TK
> > > > >
> > > > >
> > > > >
> > > > > ________________________________
> > > > > From: chrismd500
> > > > > To: DynoMotion@yahoogroups.com
> > > > > Sent: Friday, January 25, 2013 7:41 AM
> > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > >
> > > > >
> > > > > ÃÆ'‚ 
> > > > > I looked at some of the KMotion C PWM examples, and I suppose it will be something like this (for 1st motor):
> > > > >
> > > > > SetBitDirection(26,1); // IO 26 (motor 1) to output
> > > > > FPGA(IO_PWMS_PRESCALE) = 1; // 65.08kHz/2 = 32.54kHz
> > > > > FPGA(IO_PWMS+1) = 1; // enable PWM0 (@ IO 26)
> > > > >
> > > > > For the direction bit, should I use for instance IO 27? so it would look like this:
> > > > >
> > > > > SetBitDirection(27,1); // IO 27 (motor 1) to output
> > > > > FPGA(IO_PWMS+3) = 1; // enable GPIO (@ IO 27)
> > > > >
> > > > > To operate the motor:
> > > > > FPGA(IO_PWMS+0) = x; // duty cycle. x = 0 (0%) to 255 (100%)
> > > > > FPGA(IO_PWMS+2) = y; // y = 0 or 1, forward and reverse??
> > > > >
> > > > > My other question is how do I control max voltage? If I set FPGA(IO_PWMS+0) = 255 the average output voltage would be equal to the motor supply voltage I assume. But let's say that my supply voltage is 12V and max motor voltage is 9V.
> > > > >
> > > > > Thanks,
> > > > > Kris
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
> > > > > >
> > > > > > Perfect. Thanks Tom
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > > >
> > > > > > > Hi Chris,
> > > > > > >
> > > > > > > Yes you are using 7 of the 8 KFLOP Axis Channels.
> > > > > > >
> > > > > > > Yes that DC driver should work.ÃÆ'Æ'‚ÃÆ'‚  You will need 3 pins from JP6.ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > >
> > > > > > >
> > > > > > > TK
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ________________________________
> > > > > > > From: chrismd500
> > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > Sent: Thursday, January 24, 2013 4:52 PM
> > > > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > > > >
> > > > > > >
> > > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > Hi Tom,
> > > > > > >
> > > > > > > > So you are using 7 KFLOP motor axes already?
> > > > > > > Well, not sure how you define it, but I use 7 channels but "only" 5 mechanical axes as two of the axes use a slave motor each.
> > > > > > >
> > > > > > > kstep #1:
> > > > > > > ch0 + ch1(slave): Z
> > > > > > > ch2 + ch3(slave): tilt
> > > > > > >
> > > > > > > kstep #2:
> > > > > > > ch4: X
> > > > > > > ch5: Y
> > > > > > > ch6: sherline 3700 rotary
> > > > > > > ch7: none
> > > > > > >
> > > > > > > > You need 2 more motors for focus on 2 cameras?
> > > > > > > yes, two machine cameras with a Fujonon 16mm lens on each. http://www.fujifilmusa.com/products/optical_devices/machine-vision/2-3-5/hf16sa-1/
> > > > > > >
> > > > > > > That is a much better solution, I like that! So if I understand you correct that DC driver should work with kflop?
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Kris
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > > > >
> > > > > > > > Hi Kris,
> > > > > > > >
> > > > > > > > So you are using 7 KFLOP motor axes already?ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You need 2 more motors for focus on 2 cameras?
> > > > > > > >
> > > > > > > > But yes I like that device.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Like you mention I don't think it is a good idea to switch motor coils with a relay.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But that device has two motor drivers so I don't think you need to.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Just use two of KFLOP's PWM outputs to drive each of the motor drivers. ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The KFLOP PWM Outputs are on JP6.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO
> pins.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  One PWM for each motor and one common direction pin.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  To control the speed just write a PWM value to the FPGA register.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You don't need to have to use a KFLOP Axis Channel
> > for this.
> > > > > > > >
> > > > > > > > Regards
> > > > > > > > TK
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > ________________________________
> > > > > > > > From: chrismd500
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Sent: Thursday, January 24, 2013 3:34 PM
> > > > > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Thanks Tom.
> > > > > > > >
> > > > > > > > That's what I was afraid of. I thought about the relay output, but would have liked speed control.
> > > > > > > >
> > > > > > > > An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?
> > > > > > > >
> > > > > > > > If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
> > > > > > > > with the motors i mention below.
> > > > > > > >
> > > > > > > > Kris
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > > > > >
> > > > > > > > > Hi Kris,
> > > > > > > > >
> > > > > > > > > No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  That motor requires 50ma.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  See:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
> > > > > > > > >
> > > > > > > > > Regards
> > > > > > > > > TK
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ________________________________
> > > > > > > > > From: chrismd500
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Sent: Thursday, January 24, 2013 1:48 PM
> > > > > > > > > Subject: [DynoMotion] Kstep analog output
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Group: DynoMotion Message: 6658 From: Michael Rosenfield Date: 2/5/2013
Subject: Re: Kstep analog output
Here are a couple of articles on machine grounding.
They should clarify some things.
Regards,
Michael Rosenfield
 
Group: DynoMotion Message: 6659 From: Tom Kerekes Date: 2/5/2013
Subject: Re: Kstep analog output
Hi Kris,

Yes grounding is a very complex topic.  Probably not a good idea to connect the DC grounds to the chassis.

Earth ground is the 3rd usually green wire on a power plug.

Regards
TK


Group: DynoMotion Message: 6661 From: chrismd500 Date: 2/5/2013
Subject: Re: Kstep analog output
Michael,

Thanks! I've tried to find some good information on the internet, but haven't found any, so this is good.

Thanks,
Kristoffer

--- In DynoMotion@yahoogroups.com, Michael Rosenfield wrote:
>
>
> Here are a couple of articles on machine grounding.
> They should clarify some things.
> Regards,
> Michael Rosenfield
>
> To: DynoMotion@yahoogroups.com
> From: kristoffer.jensen@...
> Date: Tue, 5 Feb 2013 16:01:37 +0000
> Subject: [DynoMotion] Re: Kstep analog output
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Tom,
>
>
>
> Ok so I guess it was good I asked this question then.
>
>
>
> I'm using this DC barrel jack for http://www.radioshack.com/product/index.jsp?productId=2102486. it's not insulated on the enclosure, so the DC ground will go into the enclosure, which probably is wrong.
>
>
>
> I think I'm a little confused on earth ground and DC ground. I'm sorry, this is basic stuff that I probably should have know already. I did some research on the internet when I installed that jack, and it seemed to be so many different opinions on how to ground stuff, some people grounding to 0V and others not, so I assumed using the DC ground would be fine.
>
>
>
> So I guess what you are saying is to insulate the enclosure from the boards, and use earth ground instead? Where do I get earth ground from?
>
>
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> >
>
> > Hi Kris,
>
> >
>
> > I'm not sure I understand this.  But the enclosure should probably go to earth ground not any of the DC grounds.
>
> >
>
> > Regards
>
> > TK
>
> >
>
> >
>
> >
>
> >
>
> > ________________________________
>
> > From: chrismd500
>
> > To: DynoMotion@yahoogroups.com
>
> > Sent: Tuesday, February 5, 2013 4:29 AM
>
> > Subject: [DynoMotion] Re: Kstep analog output
>
> >
>
> >
>
> > Â
>
> > Ok, I'll add another 5v supply.
>
> >
>
> > I just want to make sure I got the grounding of the enclosure correct. Before I installed the Pololu driver the enclosure was grounded through the 5V ground (V-) which share the 24V motor power ground. The kflop was floating using the USB power. Was that the right way to do it? When I now add the Pololu driver and another 5V supply, those will be floating together with the kflop if I keep it as I had before.
>
> >
>
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> > >
>
> > > Hi Kris,
>
> > >
>
> > > I would use a separate supply for the motor side of the driver and not USB power.
>
> > >
>
> > > Regards
>
> > > TK
>
> > >
>
> > >
>
> > >
>
> > > ________________________________
>
> > > From: chrismd500
>
> > > To: DynoMotion@yahoogroups.com
>
> > > Sent: Monday, February 4, 2013 7:46 PM
>
> > > Subject: [DynoMotion] Re: Kstep analog output
>
> > >
>
> > >
>
> > > ÂÂ
>
> > > Thanks Tom.
>
> > > If I keep the 5V supply for the ksteps only, I probably need another 5v supply. The motors draw a maximum of 300mA/each. I will only operate one motor at a time.
>
> > >
>
> > > But to avoid having another 5v supply could I use a USB 2.0 y-cable to achieve 1A using two USB 2.0 ports? It's common to use that to speed up charging on some phones and tablets. Or do kflop limit to 0.5A via USB?
>
> > >
>
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> > > >
>
> > > > Hi Kris,
>
> > > >
>
> > > > Yes you absolutely need a common GND connection between KFLOP and the Pololu Driver. KFLOP outputs highs and lows relative to that GND reference, and the Pololu Driver looks for highs and lows relative to that same GND reference.
>
> > > >
>
> > > >
>
> > > > I would use the +5V and GND from KFLOP JP6 connected to the Pololu Driver regardless of how KFLOP is powered.. It should require very little logic power.
>
> > > >
>
> > > > And yes if you connected the GND to all 3 things (KSTEPS, KFLOP, and the Pololu Driver) you would defeat the KSTEP isolation feature. So don't do that. Use the +5V supply for only the KSTEPS.
>
> > > >
>
> > > > The FPGA register symbols are defined in the KMotionDef.h file as:
>
> > > >
>
> > > > #define IO_PWMS 0xD0          // FPGA offset to IO PWM registers (2 bytes each - value, enable(bit0))
>
> > > >
>
> > > >
>
> > > > The FPGA script command uses decimal values so that would be 208.  PWM #1 would be at offset 2 and 3. So 210 and 211 decimal.
>
> > > >
>
> > > > HTH
>
> > > > Regards
>
> > > > TK
>
> > > >
>
> > > >
>
> > > >
>
> > > > ________________________________
>
> > > > From: chrismd500
>
> > > > To: DynoMotion@yahoogroups.com
>
> > > > Sent: Monday, February 4, 2013 6:12 PM
>
> > > > Subject: [DynoMotion] Re: Kstep analog output
>
> > > >
>
> > > >
>
> > > > ÂÂÂ
>
> > > > Tom,
>
> > > >
>
> > > > I received the boards today, kflop seems to work perfectly (i haven't used the ksteps yet).
>
> > > >
>
> > > > I have a couple of questions regarding to PWM. I've connected the driver board from Pololu http://www.pololu.com/catalog/product/2135, and it works good except one issue.
>
> > > >
>
> > > > The kflop get power from the USB, and the Pololu driver board get the logical and motor power from a 5v power supply (that I also use for logical power for both my ksteps). I've only connected kflop JP6 IO 27 (pwm1), 28 (pwm2), and 29 (direction) to the Pololu driver 4 inputs.
>
> > > >
>
> > > > What I see is that there is a slight voltage difference (~0.3V) between the USB ground and the 5V power supply ground, so the motors start turning very slowly as soon as i plug in the USB in kflop. When I set IO 29 (direction) to high, the motors stop, when I put it back to low they start turning again.
>
> > > >
>
> > > > So my question is, should I connect the USB ground with the 5V power supply ground? I'm also considering to use the kflop power for the logical power on the Pololu driver (and use the 5v power supply for the pololu board motor power and kstep logical power). If I do that, will kflop and kstep still be opto-isolated?
>
> > > >
>
> > > > The next question is; how do I issue the "FPGA(IO_PWMS+x) = yy" via WriteLine in C++? In the manual it says it should be FPGAzzzz yy, where I assume zzzz = IO_PWMS+x. But I cannot find the numerical value of IO_PWMS.
>
> > > >
>
> > > > Thanks,
>
> > > > Kristoffer
>
> > > >
>
> > > > --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
>
> > > > >
>
> > > > > Ok, I see what you mean. So for the direction it would just be
>
> > > > > SetBitDirection(IOxx,1) and use high/setbit and low/clearbit for the direction.
>
> > > > >
>
> > > > > Thanks for the explanation on the voltage. I wasn't sure if there was a built-in function to scale the duty cycle elsewhere.
>
> > > > >
>
> > > > > Thanks,
>
> > > > > Kristoffer
>
> > > > >
>
> > > > >
>
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> > > > > >
>
> > > > > > Hi Kris,
>
> > > > > >
>
> > > > > > The simpler mode for that driver is just a direction signal and a PWM signal.ÃÆ'‚ So you don't need a PWM signal for the direction.ÃÆ'‚ Just use the pin as a General Purpose Output and set it high or clear it low for the direction.
>
> > > > > >
>
> > > > > > PWM0 is used for the KSTEP analog Generator (It is multiplexed over to JP7).ÃÆ'‚ So don't use PWM0 for your focus motor unles you never plan to use the Analog Output on KSTEP.
>
> > > > > >
>
> > > > > >
>
> > > > > > If the Max motor voltage is 9V and your supply is 12V then you should be careful to never set a PWM value greater than 9/12 x 255 = 191.ÃÆ'‚ You might add a series resistor to be safe.ÃÆ'‚ If the motor draws 50ma then to drop 3V would require a:
>
> > > > > >
>
> > > > > > 3V / 0.05A = 60 ohmsÃÆ'‚ (power dissipated = 3V x 0.05A = 150mw)
>
> > > > > >
>
> > > > > > Regards
>
> > > > > > TK
>
> > > > > >
>
> > > > > >
>
> > > > > >
>
> > > > > > ________________________________
>
> > > > > > From: chrismd500
>
> > > > > > To: DynoMotion@yahoogroups.com
>
> > > > > > Sent: Friday, January 25, 2013 7:41 AM
>
> > > > > > Subject: [DynoMotion] Re: Kstep analog output
>
> > > > > >
>
> > > > > >
>
> > > > > > ÃÆ'‚ÂÂÂ
>
> > > > > > I looked at some of the KMotion C PWM examples, and I suppose it will be something like this (for 1st motor):
>
> > > > > >
>
> > > > > > SetBitDirection(26,1); // IO 26 (motor 1) to output
>
> > > > > > FPGA(IO_PWMS_PRESCALE) = 1; // 65.08kHz/2 = 32.54kHz
>
> > > > > > FPGA(IO_PWMS+1) = 1; // enable PWM0 (@ IO 26)
>
> > > > > >
>
> > > > > > For the direction bit, should I use for instance IO 27? so it would look like this:
>
> > > > > >
>
> > > > > > SetBitDirection(27,1); // IO 27 (motor 1) to output
>
> > > > > > FPGA(IO_PWMS+3) = 1; // enable GPIO (@ IO 27)
>
> > > > > >
>
> > > > > > To operate the motor:
>
> > > > > > FPGA(IO_PWMS+0) = x; // duty cycle. x = 0 (0%) to 255 (100%)
>
> > > > > > FPGA(IO_PWMS+2) = y; // y = 0 or 1, forward and reverse??
>
> > > > > >
>
> > > > > > My other question is how do I control max voltage? If I set FPGA(IO_PWMS+0) = 255 the average output voltage would be equal to the motor supply voltage I assume. But let's say that my supply voltage is 12V and max motor voltage is 9V.
>
> > > > > >
>
> > > > > > Thanks,
>
> > > > > > Kris
>
> > > > > >
>
> > > > > > --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
>
> > > > > > >
>
> > > > > > > Perfect. Thanks Tom
>
> > > > > > >
>
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> > > > > > > >
>
> > > > > > > > Hi Chris,
>
> > > > > > > >
>
> > > > > > > > Yes you are using 7 of the 8 KFLOP Axis Channels.
>
> > > > > > > >
>
> > > > > > > > Yes that DC driver should work.ÃÆ'Æ'‚ÃÆ'‚ You will need 3 pins from JP6.ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
>
> > > > > > > >
>
> > > > > > > >
>
> > > > > > > > TK
>
> > > > > > > >
>
> > > > > > > >
>
> > > > > > > >
>
> > > > > > > > ________________________________
>
> > > > > > > > From: chrismd500
>
> > > > > > > > To: DynoMotion@yahoogroups.com
>
> > > > > > > > Sent: Thursday, January 24, 2013 4:52 PM
>
> > > > > > > > Subject: [DynoMotion] Re: Kstep analog output
>
> > > > > > > >
>
> > > > > > > >
>
> > > > > > > > ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
>
> > > > > > > > Hi Tom,
>
> > > > > > > >
>
> > > > > > > > > So you are using 7 KFLOP motor axes already?
>
> > > > > > > > Well, not sure how you define it, but I use 7 channels but "only" 5 mechanical axes as two of the axes use a slave motor each.
>
> > > > > > > >
>
> > > > > > > > kstep #1:
>
> > > > > > > > ch0 + ch1(slave): Z
>
> > > > > > > > ch2 + ch3(slave): tilt
>
> > > > > > > >
>
> > > > > > > > kstep #2:
>
> > > > > > > > ch4: X
>
> > > > > > > > ch5: Y
>
> > > > > > > > ch6: sherline 3700 rotary
>
> > > > > > > > ch7: none
>
> > > > > > > >
>
> > > > > > > > > You need 2 more motors for focus on 2 cameras?
>
> > > > > > > > yes, two machine cameras with a Fujonon 16mm lens on each. http://www.fujifilmusa.com/products/optical_devices/machine-vision/2-3-5/hf16sa-1/
>
> > > > > > > >
>
> > > > > > > > That is a much better solution, I like that! So if I understand you correct that DC driver should work with kflop?
>
> > > > > > > >
>
> > > > > > > > Thanks,
>
> > > > > > > > Kris
>
> > > > > > > >
>
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> > > > > > > > >
>
> > > > > > > > > Hi Kris,
>
> > > > > > > > >
>
> > > > > > > > > So you are using 7 KFLOP motor axes already?ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ You need 2 more motors for focus on 2 cameras?
>
> > > > > > > > >
>
> > > > > > > > > But yes I like that device.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ Like you mention I don't think it is a good idea to switch motor coils with a relay.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ But that device has two motor drivers so I don't think you need to.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ Just use two of KFLOP's PWM outputs to drive each of the motor drivers. ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ The KFLOP PWM Outputs are on JP6.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO
>
> > pins.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ One PWM for each motor and one common direction pin.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ To control the speed just write a PWM value to the FPGA register.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ You don't need to have to use a KFLOP Axis Channel
>
> > > for this.
>
> > > > > > > > >
>
> > > > > > > > > Regards
>
> > > > > > > > > TK
>
> > > > > > > > >
>
> > > > > > > > >
>
> > > > > > > > >
>
> > > > > > > > >
>
> > > > > > > > > ________________________________
>
> > > > > > > > > From: chrismd500
>
> > > > > > > > > To: DynoMotion@yahoogroups.com
>
> > > > > > > > > Sent: Thursday, January 24, 2013 3:34 PM
>
> > > > > > > > > Subject: [DynoMotion] Re: Kstep analog output
>
> > > > > > > > >
>
> > > > > > > > >
>
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
>
> > > > > > > > > Thanks Tom.
>
> > > > > > > > >
>
> > > > > > > > > That's what I was afraid of. I thought about the relay output, but would have liked speed control.
>
> > > > > > > > >
>
> > > > > > > > > An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?
>
> > > > > > > > >
>
> > > > > > > > > If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
>
> > > > > > > > > with the motors i mention below.
>
> > > > > > > > >
>
> > > > > > > > > Kris
>
> > > > > > > > >
>
> > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> > > > > > > > > >
>
> > > > > > > > > > Hi Kris,
>
> > > > > > > > > >
>
> > > > > > > > > > No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ That motor requires 50ma.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ See:
>
> > > > > > > > > >
>
> > > > > > > > > >
>
> > > > > > > > > > http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
>
> > > > > > > > > >
>
> > > > > > > > > >
>
> > > > > > > > > > The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
>
> > > > > > > > > >
>
> > > > > > > > > > Regards
>
> > > > > > > > > > TK
>
> > > > > > > > > >
>
> > > > > > > > > >
>
> > > > > > > > > >
>
> > > > > > > > > >
>
> > > > > > > > > > ________________________________
>
> > > > > > > > > > From: chrismd500
>
> > > > > > > > > > To: DynoMotion@yahoogroups.com
>
> > > > > > > > > > Sent: Thursday, January 24, 2013 1:48 PM
>
> > > > > > > > > > Subject: [DynoMotion] Kstep analog output
>
> > > > > > > > > >
>
> > > > > > > > > >
>
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ÂÂÂ
>
> > > > > > > > > > Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
>
> > > > > > > > > >
>
> > > > > > > > >
>
> > > > > > > >
>
> > > > > > >
>
> > > > > >
>
> > > > >
>
> > > >
>
> > >
>
> >
>
Group: DynoMotion Message: 6662 From: chrismd500 Date: 2/5/2013
Subject: Re: Kstep analog output
Tom, ok, I will use that instead then. Thanks, I really appreciate your support. I've learned a lot.

Thanks,
Kristoffer

--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi Kris,
>
> Yes grounding is a very complex topic.  Probably not a good idea to connect the DC grounds to the chassis.
>
> Earth ground is the 3rd usually green wire on a power plug.
>
> Regards
> TK
>
>
>
>
> ________________________________
> From: chrismd500
> To: DynoMotion@yahoogroups.com
> Sent: Tuesday, February 5, 2013 8:01 AM
> Subject: [DynoMotion] Re: Kstep analog output
>
>
>  
> Tom,
>
> Ok so I guess it was good I asked this question then.
>
> I'm using this DC barrel jack for http://www.radioshack.com/product/index.jsp?productId=2102486. it's not insulated on the enclosure, so the DC ground will go into the enclosure, which probably is wrong.
>
> I think I'm a little confused on earth ground and DC ground. I'm sorry, this is basic stuff that I probably should have know already. I did some research on the internet when I installed that jack, and it seemed to be so many different opinions on how to ground stuff, some people grounding to 0V and others not, so I assumed using the DC ground would be fine.
>
> So I guess what you are saying is to insulate the enclosure from the boards, and use earth ground instead? Where do I get earth ground from?
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> >
> > Hi Kris,
> >
> > I'm not sure I understand this.   But the enclosure should probably go to earth ground not any of the DC grounds.
> >
> > Regards
> > TK
> >
> >
> >
> >
> > ________________________________
> > From: chrismd500
> > To: DynoMotion@yahoogroups.com
> > Sent: Tuesday, February 5, 2013 4:29 AM
> > Subject: [DynoMotion] Re: Kstep analog output
> >
> >
> >  
> > Ok, I'll add another 5v supply.
> >
> > I just want to make sure I got the grounding of the enclosure correct. Before I installed the Pololu driver the enclosure was grounded through the 5V ground (V-) which share the 24V motor power ground. The kflop was floating using the USB power. Was that the right way to do it? When I now add the Pololu driver and another 5V supply, those will be floating together with the kflop if I keep it as I had before.
> >
> > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > >
> > > Hi Kris,
> > >
> > > I would use a separate supply for the motor side of the driver and not USB power.
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > > ________________________________
> > > From: chrismd500
> > > To: DynoMotion@yahoogroups.com
> > > Sent: Monday, February 4, 2013 7:46 PM
> > > Subject: [DynoMotion] Re: Kstep analog output
> > >
> > >
> > >  
> > > Thanks Tom.
> > > If I keep the 5V supply for the ksteps only, I probably need another 5v supply. The motors draw a maximum of 300mA/each. I will only operate one motor at a time.
> > >
> > > But to avoid having another 5v supply could I use a USB 2.0 y-cable to achieve 1A using two USB 2.0 ports? It's common to use that to speed up charging on some phones and tablets. Or do kflop limit to 0.5A via USB?
> > >
> > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > >
> > > > Hi Kris,
> > > >
> > > > Yes you absolutely need a common GND connection between KFLOP and the Pololu Driver.ÃÆ'‚  KFLOP outputs highs and lows relative to that GND reference, and the Pololu Driver looks for highs and lows relative to that same GND reference.
> > > >
> > > >
> > > > I would use the +5V and GND from KFLOP JP6 connected to the Pololu Driver regardless of how KFLOP is powered..ÃÆ'‚  It should require very little logic power.
> > > >
> > > > And yes if you connected the GND to all 3 things (KSTEPS, KFLOP, and the Pololu Driver) you would defeat the KSTEP isolation feature.ÃÆ'‚  So don't do that.ÃÆ'‚  Use the +5V supply for only the KSTEPS.
> > > >
> > > > The FPGA register symbols are defined in the KMotionDef.h file as:
> > > >
> > > > #define IO_PWMS 0xD0ÃÆ'‚  ÃÆ'‚ ÃÆ'‚ ÃÆ'‚  ÃÆ'‚ ÃÆ'‚ ÃÆ'‚  ÃÆ'‚ ÃÆ'‚ ÃÆ'‚  // FPGA offset to IO PWM registers (2 bytes each - value, enable(bit0))
> > > >
> > > >
> > > > The FPGA script command uses decimal values so that would be 208.ÃÆ'‚ ÃÆ'‚  PWM #1 would be at offset 2 and 3.ÃÆ'‚  So 210 and 211 decimal.
> > > >
> > > > HTH
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > > ________________________________
> > > > From: chrismd500
> > > > To: DynoMotion@yahoogroups.com
> > > > Sent: Monday, February 4, 2013 6:12 PM
> > > > Subject: [DynoMotion] Re: Kstep analog output
> > > >
> > > >
> > > > ÃÆ'‚ 
> > > > Tom,
> > > >
> > > > I received the boards today, kflop seems to work perfectly (i haven't used the ksteps yet).
> > > >
> > > > I have a couple of questions regarding to PWM. I've connected the driver board from Pololu http://www.pololu.com/catalog/product/2135, and it works good except one issue.
> > > >
> > > > The kflop get power from the USB, and the Pololu driver board get the logical and motor power from a 5v power supply (that I also use for logical power for both my ksteps). I've only connected kflop JP6 IO 27 (pwm1), 28 (pwm2), and 29 (direction) to the Pololu driver 4 inputs.
> > > >
> > > > What I see is that there is a slight voltage difference (~0.3V) between the USB ground and the 5V power supply ground, so the motors start turning very slowly as soon as i plug in the USB in kflop. When I set IO 29 (direction) to high, the motors stop, when I put it back to low they start turning again.
> > > >
> > > > So my question is, should I connect the USB ground with the 5V power supply ground? I'm also considering to use the kflop power for the logical power on the Pololu driver (and use the 5v power supply for the pololu board motor power and kstep logical power). If I do that, will kflop and kstep still be opto-isolated?
> > > >
> > > > The next question is; how do I issue the "FPGA(IO_PWMS+x) = yy" via WriteLine in C++? In the manual it says it should be FPGAzzzz yy, where I assume zzzz = IO_PWMS+x. But I cannot find the numerical value of IO_PWMS.
> > > >
> > > > Thanks,
> > > > Kristoffer
> > > >
> > > > --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
> > > > >
> > > > > Ok, I see what you mean. So for the direction it would just be
> > > > > SetBitDirection(IOxx,1) and use high/setbit and low/clearbit for the direction.
> > > > >
> > > > > Thanks for the explanation on the voltage. I wasn't sure if there was a built-in function to scale the duty cycle elsewhere.
> > > > >
> > > > > Thanks,
> > > > > Kristoffer
> > > > >
> > > > >
> > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > >
> > > > > > Hi Kris,
> > > > > >
> > > > > > The simpler mode for that driver is just a direction signal and a PWM signal.ÃÆ'Æ'‚ÃÆ'‚  So you don't need a PWM signal for the direction.ÃÆ'Æ'‚ÃÆ'‚  Just use the pin as a General Purpose Output and set it high or clear it low for the direction.
> > > > > >
> > > > > > PWM0 is used for the KSTEP analog Generator (It is multiplexed over to JP7).ÃÆ'Æ'‚ÃÆ'‚  So don't use PWM0 for your focus motor unles you never plan to use the Analog Output on KSTEP.
> > > > > >
> > > > > >
> > > > > > If the Max motor voltage is 9V and your supply is 12V then you should be careful to never set a PWM value greater than 9/12 x 255 = 191.ÃÆ'Æ'‚ÃÆ'‚  You might add a series resistor to be safe.ÃÆ'Æ'‚ÃÆ'‚  If the motor draws 50ma then to drop 3V would require a:
> > > > > >
> > > > > > 3V / 0.05A = 60 ohmsÃÆ'Æ'‚ÃÆ'‚  (power dissipated = 3V x 0.05A = 150mw)
> > > > > >
> > > > > > Regards
> > > > > > TK
> > > > > >
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > > From: chrismd500
> > > > > > To: DynoMotion@yahoogroups.com
> > > > > > Sent: Friday, January 25, 2013 7:41 AM
> > > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > > >
> > > > > >
> > > > > > ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > I looked at some of the KMotion C PWM examples, and I suppose it will be something like this (for 1st motor):
> > > > > >
> > > > > > SetBitDirection(26,1); // IO 26 (motor 1) to output
> > > > > > FPGA(IO_PWMS_PRESCALE) = 1; // 65.08kHz/2 = 32.54kHz
> > > > > > FPGA(IO_PWMS+1) = 1; // enable PWM0 (@ IO 26)
> > > > > >
> > > > > > For the direction bit, should I use for instance IO 27? so it would look like this:
> > > > > >
> > > > > > SetBitDirection(27,1); // IO 27 (motor 1) to output
> > > > > > FPGA(IO_PWMS+3) = 1; // enable GPIO (@ IO 27)
> > > > > >
> > > > > > To operate the motor:
> > > > > > FPGA(IO_PWMS+0) = x; // duty cycle. x = 0 (0%) to 255 (100%)
> > > > > > FPGA(IO_PWMS+2) = y; // y = 0 or 1, forward and reverse??
> > > > > >
> > > > > > My other question is how do I control max voltage? If I set FPGA(IO_PWMS+0) = 255 the average output voltage would be equal to the motor supply voltage I assume. But let's say that my supply voltage is 12V and max motor voltage is 9V.
> > > > > >
> > > > > > Thanks,
> > > > > > Kris
> > > > > >
> > > > > > --- In DynoMotion@yahoogroups.com, "chrismd500" wrote:
> > > > > > >
> > > > > > > Perfect. Thanks Tom
> > > > > > >
> > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > > > >
> > > > > > > > Hi Chris,
> > > > > > > >
> > > > > > > > Yes you are using 7 of the 8 KFLOP Axis Channels.
> > > > > > > >
> > > > > > > > Yes that DC driver should work.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You will need 3 pins from JP6.ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > >
> > > > > > > >
> > > > > > > > TK
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > ________________________________
> > > > > > > > From: chrismd500
> > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > Sent: Thursday, January 24, 2013 4:52 PM
> > > > > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > > > > >
> > > > > > > >
> > > > > > > > ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > Hi Tom,
> > > > > > > >
> > > > > > > > > So you are using 7 KFLOP motor axes already?
> > > > > > > > Well, not sure how you define it, but I use 7 channels but "only" 5 mechanical axes as two of the axes use a slave motor each.
> > > > > > > >
> > > > > > > > kstep #1:
> > > > > > > > ch0 + ch1(slave): Z
> > > > > > > > ch2 + ch3(slave): tilt
> > > > > > > >
> > > > > > > > kstep #2:
> > > > > > > > ch4: X
> > > > > > > > ch5: Y
> > > > > > > > ch6: sherline 3700 rotary
> > > > > > > > ch7: none
> > > > > > > >
> > > > > > > > > You need 2 more motors for focus on 2 cameras?
> > > > > > > > yes, two machine cameras with a Fujonon 16mm lens on each. http://www.fujifilmusa.com/products/optical_devices/machine-vision/2-3-5/hf16sa-1/
> > > > > > > >
> > > > > > > > That is a much better solution, I like that! So if I understand you correct that DC driver should work with kflop?
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > > Kris
> > > > > > > >
> > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > > > > >
> > > > > > > > > Hi Kris,
> > > > > > > > >
> > > > > > > > > So you are using 7 KFLOP motor axes already?ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You need 2 more motors for focus on 2 cameras?
> > > > > > > > >
> > > > > > > > > But yes I like that device.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Like you mention I don't think it is a good idea to switch motor coils with a relay.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  But that device has two motor drivers so I don't think you need to.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  Just use two of KFLOP's PWM outputs to drive each
> of the motor drivers. ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  The KFLOP PWM Outputs are on JP6.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  If you don't need to move both motors at the same time (in different directions) then you could get by with 3 IO
> > pins.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  One PWM for each motor and one common direction pin.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  To control the speed just write a PWM value to the FPGA register.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  You don't need to have to use a KFLOP Axis Channel
> > > for this.
> > > > > > > > >
> > > > > > > > > Regards
> > > > > > > > > TK
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ________________________________
> > > > > > > > > From: chrismd500
> > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > Sent: Thursday, January 24, 2013 3:34 PM
> > > > > > > > > Subject: [DynoMotion] Re: Kstep analog output
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > Thanks Tom.
> > > > > > > > >
> > > > > > > > > That's what I was afraid of. I thought about the relay output, but would have liked speed control.
> > > > > > > > >
> > > > > > > > > An issue related to this is that I have only one channel free on the kflop and need two channels (for the two small lens focus motors). I don't really want get into getting another kflop, so I had this idea that I maybe could use a DPDT switch/relay between a DC motor driver and two DC brushed motors. I thought it could be done with a brushed DC motor since it has zero (?) electricity applied to it when stopped. I also assumed this could not be done with a stepper motor since it's energized as long as the driver is powered on. Or maybe this is just a big no-no and I should scratch the idea completely?
> > > > > > > > >
> > > > > > > > > If I can't use kstep I thought about a small driver like this: http://www.pololu.com/catalog/product/2135 (just using one of the two channels)
> > > > > > > > > with the motors i mention below.
> > > > > > > > >
> > > > > > > > > Kris
> > > > > > > > >
> > > > > > > > > --- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
> > > > > > > > > >
> > > > > > > > > > Hi Kris,
> > > > > > > > > >
> > > > > > > > > > No the KStep Analog Output has a series resistance of 1Kohms which could be used for about 6ma.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  That motor requires 50ma.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  See:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > http://www.dynomotion.com/Help/SchematicsKStep/IsolatedPWMtoAnalog.png
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > The two KSTEP Relay driver outputs can drive 100ma and should be capable of driving it.ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚  I think with two resistors there is an arrangement that would allow it to be driven forward or reverse.
> > > > > > > > > >
> > > > > > > > > > Regards
> > > > > > > > > > TK
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ________________________________
> > > > > > > > > > From: chrismd500
> > > > > > > > > > To: DynoMotion@yahoogroups.com
> > > > > > > > > > Sent: Thursday, January 24, 2013 1:48 PM
> > > > > > > > > > Subject: [DynoMotion] Kstep analog output
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'†'ÃÆ'Æ'Æ'ÃÆ'‚¢ÃÆ'Æ'¢ÃÆ'¢â‚¬Å¡ÃÆ'‚¬ÃÆ'Æ'…ÃÆ'‚¡ÃÆ'Æ'Æ'ÃÆ'†'ÃÆ'Æ'¢ÃÆ'¢â€šÂ¬ÃÆ'…¡ÃÆ'Æ'Æ'ÃÆ'¢â‚¬Å¡ÃÆ'Æ'‚ÃÆ'‚ 
> > > > > > > > > > Maybe a stupid question: Can the Kstep analog PWM output be used for a miniature DC brush motor? For instance like this http://www.robotshop.com/solarbotics-gm14-gear-motor-2.html
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>